#! /usr/bin/python
#                   _ooOoo_                     
#                  o8888888o                    
#                  88" . "88                    
#                  (| -_- |)                    
#                  O\  =  /O                    
#               ____/`---'\____                 
#             .'  \\|     |//  `.               
#            /  \\|||  :  |||//  \              
#           /  _||||| -:- |||||-  \             
#           |   | \\\  -  /// |   |             
#           | \_|  \---/  |   |             
#           \  .-\__  `-`  ___/-. /             
#         ___`. .'  /--.--\  `. . __            
#      ."" '<  `.___\_<|>_/___.'  >'"".      
#     | | :  `- \`.;`\ _ /`;.`/ - ` : | |       
#     \  \ `-.   \_ __\ /__ _/   .-` /  /       
#======`-.____`-.___\_____/___.-`____.-'======  
#                   `=---='                     
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
#         Buddha bless me for no bug            
#                                               
####################################################################################
#   Filename    :  error.py                                                      
#   Author      :  Shawn Tan                                                        
#   Date        :  2017.2.22                                                        
#   Description :                                                                   
#   History     :  2017.2.22             creat the document            Shawn Tan    
####################################################################################
__author__ = 'ST-CAT'

#################################################################################
#                              Tdef Error
#################################################################################
tdef000 = ''' \033[31;1m *E (TDEF000) : MISTDEFENV : runsim can't obtain parser.rc files path!
  1. you can use "runsim -l <<your_parser_rc_fils>>" to give a valid parser.rc path  
  2. or you can set a global environment named "STARBLAZE_ENV"  and value it with your parser.rc path 
  **Notes**
    a valid parser.rc path is the location of your parser.rc files\033[0m  
'''
tdef001 = ''' \033[31;1m *E(TDEF001) : TDEFCLASH : you can't designate both parser.rc files and a standalone tdef files

  Command "runsim -l parser.rc --tdef tdef_files ........" is illegal\033[0m

'''
tdef002 = ''' \033[31;1m *E(TDEF002) : OPPARFAL : Open Parser.rc Files Failed, Please check the parser.rc you designated
which listed above. Maybe your file is not available.\033[0m
'''

tdef003 = ''' \033[31;1m *E(TDEF003) : OPTDEFFAL : Openg Tdef Files Failed, Please check the parser.rc you designated
which listed above. Maybe your file is not available.\033[0m
'''

tdef004 = ''' \033[31;1m *E(TDEF004) : NAMECLASH : Test/Group naming clash, there are more than one test/group with the same name as :\033[0m
'''

tdef005 = ''' \033[31;1m *E(TDEF005) : SESCLASH : SESSION naming clash, there are more than one session with the same name as :  
'''

tdef006 = ''' \033[31;1m *E(TDEF006) : SESFMTERR : Syntax Error. a valid session header declaraton must be like that:  
              session {
                .............
              }
              your session header declaration  miss '{' with session name declaration like : \033[0m
'''

tdef007 = ''' \033[31;1m *E(TDEF007) : SESNEST : Syntax Error. Declaring another session container inside a sesssion containder is illegal :   
this error will be caused by that you don't use a symbol like '}' to end the previous session defination.
Please check that : \033[0m
 
'''

tdef008 = ''' \033[31;1m *E(TDEF008) : SESINVALID : Syntax Error. the sesssion declaraton like that below is illegal 
              
              session { ...................}
              
              as example above, '{' and '}' in the same line is illegal 

Please check your info : \033[0m

'''
tdef009 = ''' \033[31;1m *E(TDEF009) : SESFMTERR : Syntax Error, a valid sesssion container declaration header must stand at a independent line : "
the example like below is illegal :
              
              drm = lsf session { 
                ...............
              }
Please check that :\033[0m
'''

tdef010 = ''' \033[31;1m *E(TDEF010) : GETSESNAMEFAL : Syntax Error, can 't catch valid session name from you description. 
please check that : \033[0m 
'''

tdef011 = ''' \033[31;1m *E(TDEF011) : GRPFMTERR : Syntax Error. a valid group header declaraton must be like that:  
              group {
                .............
              }
              your group header declaration  miss '{' with group name declaration like : \033[0m
'''

tdef012 = ''' \033[31;1m *E(TDEF012) : GRPINVALID : Syntax Error. the group declaraton like that below is illegal 
              
              group { ...................}
              
              as example above, '{' and '}' in the same line is illegal 

Please check your info : \033[0m
'''

tdef013 = ''' \033[31;1m *E(TDEF013) : GETGRPNAMEFAL : Syntax Error, can 't catch valid group name from you description. 
please check that : \033[0m
'''

tdef014 = ''' \033[31;1m *E(TDEF014) : TSTFMTERR : Syntax Error. a valid test header declaraton must be like that:  
              test {
                .............
              }
              your test header declaration  miss '{' with test name declaration like : \033[0m
'''

tdef015 = ''' \033[31;1m *E(TDEF015) : TSTINVALID : Syntax Error. the test declaraton like that below is illegal 
              
              test { ...................}
              
              as example above, '{' and '}' in the same line is illegal 

Please check your info : \033[0m
'''

tdef016 = ''' \033[31;1m *E(TDEF016) : GETTSTNAMEFAL : Syntax Error, can 't catch valid test name from you description. 
please check that : \033[0m
'''

tdef017 = ''' \033[31;1m *E(TDEF017) : EMPTYBODY : Syntax Error, you define a empty session container without any test, group
and attibute  named : \033[0m
'''

tdef018 = ''' \033[31;1m *E(TDEF018) : CONTCLASH : Syntax Error, you define two "{" in a test container
like that:
         test A {
           { .......   
         }
  '{' and '}' must appear in pairs

please check the test container named : \033[0m
'''

tdef019 = ''' \033[31;1m *E(TDEF019) : EXPOUTBOUND : Syntax Error, Illegal tdef expression : \033[0m
'''

tdef020 = ''' \033[31;1m *E(TDEF020) : ATTRFMTERR : Syntax Error , attribute additon expression won't be permitted use two operator of '+=' like below:

      attibute += ....... += ........

please check that : \033[0m
'''

tdef021 = ''' \033[31;1m *E(TDEF021) : ATTRNAMEERR : Syntax Error, the attibute name you give is not a legal attibute name
 plase read the "rusnim" user guide for reason \033[0m
'''

tdef022 = ''' \033[31;1m *E(TDEF022) : ATTRFMTERR : Syntax Error, attribute remove expression won't be permitted use two operator of '-=' like below:

      attibute -= ....... -= ........

please check that : \033[0m
'''

tdef023 = ''' \033[31;1m *E(TDEF023) : DBDEFTST : Syntax Error, Define tests with same name twice in one group
please check the detail: \033[0m

'''

tdef024 = ''' \033[31;1m *E(TDEF024) : DBDEFTGRP : Syntax Error, Define groups with same name twice in one session
please check the detail: \033[0m

'''
tdef025 = ''' \033[31;1m *E(TDEF025) : GRPEXTERR : Syntax Error, group extends expression error, the legal expression is:

  group A (B, C, D){

  please check the details: \033[0m
'''

tdef026 = ''' \033[31;1m *E(TDEF026) : EXTGRPMIS : Syntax Error, can't find extends group \033[0m
'''

tdef027 = ''' \033[31;1m *E(TDEF027) : EXTTSTCLASH : Syntax Error, some tests with same name will be import a new group by extending\033[0m 
'''

tdef028 = ''' \033[31;1m *E(TDEF028) : DBDEFTST : Syntax Error, Define tests with same name twice in one session
please check the detail: \033[0m
'''

tdef029 = ''' \033[31;1m *E(TDEF029) : DBTYPERR : Data base type Error, expect TYPE REGRESSION \033[0m
'''

tdef030 = ''' \033[31;1m *E(TDEF030) : TSTNAMEERR : Regression Name Format Error : 
legal Name is as below:
  
  1. SessionName/GroupName/TestName
  2. GroupName/TestName
  3. SessionName
  4. GroupName
  5. TestName

Please check the detail: \033[0m
'''

tdef031 = ''' \033[31;1m *E(TDEF031) : NAMECLASH : Specify a test whose name has been registered as group name \033[0m
'''
tdef032 = ''' \033[31;1m *E(TDEF032) : INVNAME : Can't Find valid test info by your name \033[0m
'''
tdef033 = ''' \033[31;1m *E(TDEF033) : VARTYPERR :  Vairialbe is not a list \033[0m
'''
tdef034 = ''' \033[31;1m *E(TDEF034) : GRPMISS : GROUP name not found : \033[0m'''

tdef035 = ''' \033[31;1m *E(TDEF035) : TSTMISS : TEST name not found : \033[0m'''

tdef036 = ''' \033[31;1m *E(TDEF036) : EDAERR  : EDA vendor can't found \033[0m  
   Now we support EDA tools as belows : 

    1. synopsys
    2. cadence
    3. mentor
\033[0m
'''

tdef037 = ''' \033[31;1m *E(TDEF037) : ENVNOTSET : ENVIROMENT VARIABLE NOT SET  \033[0m
'''

tdef038 = ''' \033[31;1m *E(TDEF038) : ATTRERR1 : you use a test-only attibute in group/seesion : \033[0m
'''
tdef039 = ''' \033[31;1m *E(TDEF039) : ATTRERR2 : you use a group/session-only attibute in test : \033[0m
'''

tdef040 = ''' \033[31;1m *E(TDEF040) : FULLPATH :  Please use the full path to search test: \033[0m
'''


###################################################################################
#                              Main Error
###################################################################################
main000 = ' \033[31;1m *E (MAIN000) : CMDERR : Invalid Command to "runsim", please read details above\033[0m'

###################################################################################
#                              Command Error
###################################################################################
cmd000 = '''\033[31;1m *E(CMD000) : CMDLINEERR0 : Found no valid command from input, 
you give no test name for simulation
please use runsim -h to read HelpMe \033[0m'''

cmd001 = '''\033[31;1m *E(CMD001) : CMDLINEERR1 : Found no valid command from input, 
you give no test name or regression directory for rescan/rerun
please use runsim -h to read HelpMe \033[0m
'''

cmd002 = '''\033[31;1m *E(CMD002) : CMDLINEERR2 : Found no valid command from input, 
you give no test name and seed for log view
please use runsim -h to read HelpMe \033[0m
'''

###################################################################################
#                              Executor Error
###################################################################################
exec000 = '''\033[31;1m *E(EXEC000) : DIRTYPERR : SOLVE DIR function type error 
permit type is :

   'BUILD_REGRESSION',
   'BUILD_GROUP',
   'BUILD_TEST',
   'BUILD_PROFILE',
   'BUILD_VERDI'
   'FIND_REGRESSION',
   'FIND_GROUP',
   'FIND_TEST',
   'FIND_PROFILE'
   'FIND_VERDI'
   'FIND_GROUP_ROOT'
   'FIND_TEST_ROOT'

\033[0m
''' 
exec001 = '''\033[31;1m *E(EXEC001) : ACTTYPERR : Actions is not 'RUNSIM_ACT' when registering your case\033[0m
'''

exec002 = ''''\033[31;1m *E(EXEC002) : MULTIRUNSAMESEED : you are not permitted to run a case multi-times with 
a same seed
\033[0m
'''

exec003 = ''''\033[31;1m *E(EXEC003) : CMDERR : script_writer parser cmd type is not permitted
\033[0m
'''

exec004 = ''''\033[31;1m *E(EXEC004) : RTLSRCMISS : you do not give a RTL source with rtl_file_list/git_cfg
\033[0m
'''

exec005 = ''''\033[31;1m *E(EXEC005) : VIPSRCMISS : you do not give a VIP source with vip_file_list
\033[0m
'''
exec006 = ''''\033[31;1m *E(EXEC006) : TBSRCMISS : you do not give a TB source with tb_file_list
\033[0m
'''

exec007 = ''''\033[31;1m *E(EXEC007) : LSFMODEERR : drm mode you set is not permit 
permit mode :
1. lsf
2. serial_local
3. parallel_local
\033[0m
'''

exec008 = ''''\033[31;1m *E(EXEC008) : COMPDIRMIS : the compile dir needed by your case is not exist 
\033[0m
'''

exec009 = ''''\033[31;1m *E(EXEC009) : COMPFAIL : compile Fail during simulaiton 
\033[0m
'''

exec010 = ''''\033[31;1m *E(EXEC010) : LOGVIEWERR : you can't view multi-log by one command 
\033[0m
'''

exec011 = ''''\033[31;1m *E(EXEC011) : LOGVIEWSDMIS : you miss the case seed when viewing a simulation log 
\033[0m
'''
exec012 = ''''\033[31;1m *E(EXEC012) : LOGMIS : log you want to view is not exited 
\033[0m
'''

exec013 = ''''\033[31;1m *E(EXEC013) : SIMDIRMIS : the waveform dir is not exits when open verdi
\033[0m
'''

exec014 = ''''\033[31;1m *E(EXEC014) : TBVERDIMIS : the tb top miss when open verdi
\033[0m
'''

exec015 = ''''\033[31;1m *E(EXEC015) : RESCANDIRMIS : can't get rescan dir path with give a name/directory
\033[0m
'''

exec016 = ''''\033[31;1m *E(EXEC016) : DIRSEEDERR : seed from dir scan can't match to env.sh info  
\033[0m
'''
###################################################################################
#                                  LSF ERROR                                      # 
###################################################################################

lsf000 = "\033[31;1m LSF_000 : Compile Task submit to LSF error : \033[0m"

###################################################################################
#                              Step2Step Info
###################################################################################
info000 = "\033[32;1m INFO_000 : Warning!, Can't find any match information in : \033[0m"

info001 = "\033[32;1m INFO_001 : Complete read the parser.rc' \033[0m"

info002 = "\033[32;1m INFO_002 : Open the tdef files named : \033[0m" 

info003 = "\033[32;1m INFO_003 : Complete Parsing \033[0m"

info004 = "\033[32;1m INFO_004 : Stop \033[0m"

info005 = "\033[32;1m INFO_005 : Completed parsing all the tdef files information\033[0m" 

info006 = '\033[32;1m INFO_006 : Register a task named : \033[0m'

info007 = '\033[32;1m INFO_007 : Begin to run a task named : \033[0m'

info008 = '\033[32;1m INFO_008 : Stop a Thread named : \033[0m'

info009 = '\033[32;1m INFO_009 : Push a task named :\033[0m '

info010 = '''*********************************************************************************
**                               TESTCASE LIST                                 **
*********************************************************************************'''

info011 = '''\033[32;1m Submit a task to OpenLava : \033[0m'''
info012 = '''\033[32;1m \nComplete a task on OpenLava : \033[0m'''




